package org.qqcui.designpattern.patterns.watcher.observer;


/**
 * 观察者模式客户端
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/6 15:25
 **/
public class Client {

    public static void main(String[] args) {
        CurrentConditions currentConditions = new CurrentConditions();
        BaiduSite baiduSite = new BaiduSite();

        WeatherData weatherData = new WeatherData();
        weatherData.registerObserver(currentConditions);
        weatherData.registerObserver(baiduSite);

        System.out.println("=============通知各个观察者查看新信息：");
        weatherData.setData(10, 30, 50);
    }
}
